package exe;

/**
 * @author oldliu
 * @since 1.0
 */
public class ReverseArray {
    public static void main(String[] args) {
        int d[] = {  1,2,3,4,5,6,7,8,9};
        for(int i=0;i<d.length/2;i++){
            //把顺数第i和到倒数第i个调换位置
            //d[i],d[d.length-1-i]
            int temp=d[i];
            d[i]=d[d.length-1-i];
            d[d.length-1-i]=temp;
        }
        for (int i = 0; i < d.length; i++) {
            System.out.print(d[i]+"\t");
        }
    }
}
